import request from '@/utils/request'

// 按条件分页查询资源接口
export const getResourcePages = data => {

   return request ({
    method: 'POST',
    url: '/boss/resource/getResourcePages',
    data
   })
}

// 新增或者编辑资源。
export const createOrderUpdateResource = (data) => {
   return request({
     method: 'POST',
     url: '/boss/resource/saveOrUpdate',
     data
   })
 }

//  获取资源信息。
export const getEditResourceInfo = id => {
   return request({
      method: 'GET',
      url: `/boss/resource/${id}`,
    })
}

// 删除资源信息
export const deleteResource = id => {
   return request({
      method: 'DELETE',
      url: `/boss/resource/${id}`,
    }) 
}

// 查询资源分类接口
export const getResourceCategories = () => {
   return request({
     method: 'GET',
     url: '/boss/resource/category/getAll'
   })
 }